//
// Created by 86134 on 2024/1/18.
//

#ifndef SOCKET_SOCKET_H
#define SOCKET_SOCKET_H
#include "Connection.hpp"

namespace DBServer 
{
namespace Socket 
{
    
    // create a socket fd which packaged by Connection Object
    int socket_client(Connection& conn);
    int socket_server(Connection& conn);
    int socket_accept(Connection& conn, int fd);

    // close the fd, return the connection to the object pool
    int socket_close(Connection&);

    int socket_set_unblock(Connection&);
    int socket_set_reuse(Connection&);

    bool socket_get_unblock(Connection&);
    bool socket_get_reuse(Connection&);
}
}



#endif //SOCKET_SOCKET_H
